﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Data.Linq.Mapping;
using BryhtCommon;


namespace MyRunDataBase
{
    [Table]
    public class SportFootModel : NotifyPropertyModelBase
    {
        private int _id = 0;
        [Column(IsPrimaryKey = true, IsDbGenerated = true)]
        public int Id
        {
            get { return _id; }
            set
            {
                this.NotifyPropertyChanging(p => p.Id);
                _id = value;
                this.NotifyPropertyChanged(p => p.Id);
            }
        }

        private int _sportId = 0;
        [Column]
        public int SportId
        {
            get { return _sportId; }
            set
            {
                this.NotifyPropertyChanging(p => p.SportId);
                _sportId = value;
                this.NotifyPropertyChanged(p => p.SportId);
            }
        }

        private double _longitude = 0;
        [Column]
        public double Longitude
        {
            get { return _longitude; }
            set
            {
                this.NotifyPropertyChanging(p => p.Longitude);
                _longitude = value;
                this.NotifyPropertyChanged(p => p.Longitude);
            }
        }

        private double _latitude = 0;
        [Column]
        public double Latitude
        {
            get { return _latitude; }
            set
            {
                this.NotifyPropertyChanging(p => p.Latitude);
                _latitude = value;
                this.NotifyPropertyChanged(p => p.Latitude);
            }
        }

        private DateTime _timePoint = DateTime.Now;
        [Column]
        public DateTime TimePoint
        {
            get { return _timePoint; }
            set
            {
                this.NotifyPropertyChanging(p => p.TimePoint);
                _timePoint = value;
                this.NotifyPropertyChanged(p => p.TimePoint);
            }
        }

        private double _speed = 0;
        [Column]
        public double Speed
        {
            get { return _speed; }
            set
            {
                this.NotifyPropertyChanging(p => p.Speed);
                _speed = value;
                this.NotifyPropertyChanged(p => p.Speed);
            }
        }

        public Point ChinaOffset { get; set; }

        public double ChinaLongitude
        {
            get { return Longitude + ChinaOffset.X; }
        }

        public double ChinaLattitude
        {
            get { return Latitude + ChinaOffset.Y; }
        }

    }
}
